<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>填写信息</title>
	<script type="text/javascript" src="Public/org/jquery.js"></script>
	<link rel="stylesheet" type="text/css" href="Public/org/home/css/myCartForm.css"/>
	<!-- <link rel="stylesheet" type="text/css" href="fonts/awesome/css/font-awesome.min.css"/>	 -->
	<script type="text/javascript" src="<?php echo __VIEW__?>/Pay/pay.js"></script>
</head>
<body>
	<!--顶部-->
		<header>
			<div class="nav">
				<img alt="凡客诚品" src="Public/org/home/images/Vshop.png">
				<p>
					<a href="#" class="helpCenter">帮助中心</a>
				</p>				
			</div>	
			<!--进度-->
			<div class="flow">
				<span style="color:#000;">1.我的购物车</span>
				<span class="active">2.填写核对信息单</span>
				<span>3.成功提交订单</span>
			</div>
			<!--进度结束-->
		</header>
		<!--顶部 end-->

	<!-- 填写信息 -->
	<div class="con">
		<!-- 收货地址 -->
		<div class="address">
			<p class="public">收货地址</p>
			
			<section class="addressCon">
			<?php foreach($addr as $value):?>
				<section onclick="postAddress(this)" style="float:left;">
				<input type="hidden" name="userid" value="<?php echo $value['id']?>">
					<span class="postUser"><?php echo $value['postname']?></span>
					<span class="postTel"><?php echo $value['phone']?></span>
					<p class="city">
						<span class="postAddr"><?php echo $value['sheng']?></span>
						<span class="postAddr"><?php echo $value['shi']?></span>
						<span class="postAddr"><?php echo $value['qu']?></span>
					</p>
					<p class="newAddr"><?php echo $value['address']?></p>
					<a href="#" class="edit">编辑</a>
				</section>
			<?php endforeach;?>		
				<h4><a href=""><strong>+</strong>添加新地址</a></h4>				
			</section>
			
		</div>
		<!-- 配送方式 -->
		<div class="postChoose">
			<p class="public">配送方式</p>
			<section class="postCon">
				<span onclick="postType(this)">周一至周五、工作日送货</span>
				<span onclick="postType(this)">周六、周日、假日送货</span>
				<span onclick="postType(this)">周一到周日、假日均可送货</span>
				<h4>声明:</h4>
				<section>
					<p>1. 查看货到付款配送范围</p>
					<p>2. 送货时间：早 8:30至 晚7:30</p>
					<p>3. 我们会努力按照您选择的时间进行配送，但因天气、交通等因素影响，您的订单有可能会有延误现象，请您谅解！</p>
				</section>				
			</section>
		</div>
		<!-- 支付方式 -->
		<div class="payChoose">
			<p class="public min">支付方式</p>
			<section class="payCon">
				<section onclick="payType(this)">
					<input type="hidden" name="pay" value="1">
					<p class="pd">在线支付</p>
					<p class="minpd"><a href="">查看银行列表</a></p>
				</section>
				<section onclick="payType(this)">
					<input type="hidden" name="pay" value="2">
					<p class="pd">货到付款</p>
					<p class="minpd">现金</p>
				</section>				
			</section>
		</div>
	</div>
	<!-- 填写信息end -->

	<!-- 开发票 -->
		<div class="salesTicket">
			<h4>
				<span></span>
				开发票
			</h4>
			<section>
					<span class="title">你需要开具发票吗？</span>
					<input class="radio" id="ticket" type="radio" name="ticket" value="1" onclick="salesTicket(this)">是
					<input class="radio" id="ticket" type="radio" name="ticket" value="0" onclick="salesTicket(this)">否
					<p>*
						<span>客户类型：</span>
						<select>
							<option>个人</option>
							<option>个体工商户</option>
							<option>外籍</option>
							<option>港、澳、台</option>
						</select>
					</p>
					<p>*
						<span>发票抬头：</span>
						<input type="text" value="">
					</p>
					<p>*
						<span>发票内容：</span>
						<select>
							<option>服装</option>
						</select>
					</p>
			</section>
		</div>
	<!-- 开发票end -->

	<!-- 清单 -->
	<div class="qingdan">
		<section style="">
			<span class="qd">商品清单</span>
			<a href="<?php echo U('Cart/cart')?>" style="">回到购物车，修改产品>></a>
		</section>
		<section style="background: none;">
			<strong>订单1</strong>
			<span class="ps">将从
				<label>北京二库</label>
				发出，预计发货后
				<label>1天</label>
				内送达
			</span>
		</section>
	</div>
	<!-- 清单end -->
<form method="post" action="<?php echo U('Pay/paydone')?>">
<input type="hidden" name="postAddress" value="">
<input type="hidden" name="postType" value="">
<input type="hidden" name="payType" value="">
<input type="hidden" name="salesTicket" value="0">
<input type="hidden" name="allpay" value="">
<input type="hidden" name="" value="">
	<!-- 购物车内商品信息 -->
				<div class="bill">
					<table>
						<thead>
							<tr>
								<th class="name">商品名称</th>
								<th class="size">尺寸</th>
								<th class="price">单价(￥)</th>
								<th class="num">数量</th>
								<th class="mintotal">小计(￥)</th>
							</tr>
						</thead>
						<tbody>
						<?php foreach($data as $value):?>
							<tr class="goodsconfirm">
							<input type="hidden" name="goods_id[]" value="<?php echo $value['goods_id']?>">
								<td class="pd"><a href="<?php echo U('Detail/show',array('goods_id'=>$value['goods_id']))?>"><?php echo $value['goods_name']?></a></td>
								<td class="center"><a href="<?php echo U('Detail/show',array('goods_id'=>$value['goods_id']))?>"><?php echo $value['size']?></a></td>
								<td class="center"><?php echo $value['price']?></td>
								<td class="center"><?php echo $value['total']?></td>
								<td class="center minprice"><?php echo $value['minprice']?></td>
							</tr>
						<?php endforeach;?>								
						</tbody>
					</table>
					<p class="totalMsg">商品金额小计:
						<span id="minprice"></span>   +  运费:
						<span>￥10.00</span>   =  应付:
						<span id="total" class="total"></span>
					</p>
				</div>
				<!-- 购物车内商品信息end -->

				<!-- 结算信息 -->
				<div class="payBill">
					<p>
						已支付：<span>￥0.00</span>,您还需支付：<span id="allpay"></span>
					</p>
					<section class="btn">
						<button type="submit" class="pay" style="border:0;">提交订单</button>
					</section>
				</div>
				<!-- 结算信息end -->
</form>
	<!--页脚-->
    	<footer style="border:0;">
    		<p class="copyRight" style="color:#999;margin-bottom: 0;">Copyright 2007 - 2014 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11011502002400号 出版物经营许可证新出发京批字第直110138号</p>
    		<div class="iconMsg">
    			<section class="iconDetail">
    				<a href="#" class="one"></a>
    				<a href="#" class="two"></a>
    				<a href="#" class="three"></a>
    				<a href="#" class="four"></a>
    				<a href="#" class="five"></a>
    				<a href="#" class="six"><img src="Public/org/Home/images/kexin_brand_for_others.png"/></a>
    			</section>
    		</div>
    	</footer>
    <!--页脚end-->
</body>
<!-- 进来就获取数据 -->
<script type="text/javascript">
$(function(){
		var cash = 0;
		var all = 0;
	$('.goodsconfirm').each(function(){
			cash += $(this).find('.minprice').html()*1;
		});
		all = cash + 10;
		$('#minprice').html('￥'+cash+'.00');
		$('#total').html('￥'+all+'.00');
		$('#allpay').html('￥'+all+'.00');
		$('input[name=allpay]').val(all);
});
</script>
<!-- 进来获取数据end -->

<!-- 获取配送地址 -->
<script type="text/javascript">
function postAddress(obj)
{
	$(obj).attr('class','addr').siblings().removeAttr('class','addr');
	var postAddr_userid = $(obj).find('input[name=userid]').val();
	$('input[name=postAddress]').val(postAddr_userid);
}
</script>
<!-- 获取配送地址end -->

<!-- 配送方式 -->
<script type="text/javascript">
function postType(obj)
{
	$(obj).attr('class','active').siblings().removeAttr('class','active');
	var postType = $(obj).html();
	$('input[name=postType]').val(postType);
}
</script>
<!-- 配送方式end -->

<!-- 支付方式 -->
<script type="text/javascript">
function payType(obj)
{
	$(obj).attr('class','active').siblings().removeAttr('class','active');
	var pay = $(obj).find('input[name=pay]').val();
	$('input[name=payType]').val(pay);
}
</script>
<!-- 支付方式end -->

<!-- 发票 -->
<script type="text/javascript">
function salesTicket(obj)
{
	$(obj).attr('checked',true).siblings().removeAttr('checked',false);
	var ticket = $(obj).val();
	$('input[name=salesTicket]').val(ticket);
}
</script>
<!-- 发票end -->
</html>